1. Field of the Invention
The present invention relates to a shading correcting method and a shading correcting apparatus for reducing nonuniformity in the density of a read image in an image reading apparatus such as a facsimile or an image scanner.
2. Description of the Related Art
In an image reading apparatus such as a facsimile or an image scanner, so-called shading correction is made so as to compensate for nonuniformity in the density between pixels due to, for example, nonuniformity in illumination of a light source for reading. In the shading correction, digital data obtained by converting an output analog signal of the image sensor using an analog-to-digital converter (hereinafter referred to as "A/D converter") is subjected to correction based on the following expression (1): ##EQU1##
In the expression (1), a "black reference value" is a value in a case where a pixel signal outputted from the image sensor is converted into digital data when a deep black reference image is read, and a "white reference value" is a value in a case where a pixel signal outputted from the image sensor is converted into digital data when a pure white reference image is read. For example, the black reference value can be obtained by turning a light source for reading of the image sensor off to cause the image sensor to perform a reading operation, and the white reference value can be obtained by turning the light source for reading on to cause the image sensor to read a white reference plate.
The basic construction for making shading correction is shown in FIG. 7. Specifically, the difference between a white reference value WST and a black reference value BST (WST-BST) is operated by a subtracter 151. In addition, the difference between input data ID and the black reference value BST (ID-BST) is operated by a subtracter 152. Respective outputs of the subtracters 151 and 152 are applied to a divider circuit 153, where output data of the subtracter 152 (ID-BST) is divided by output data of the subtracter 151 (WST-BST), to obtain correction data.
In the above described shading correction, the minimum value of the input data is the white reference value. When the white reference value is higher the minimum output of the A/D converter, therefore, the dynamic range of the correction value is narrowed. For example, if the white reference value is "0000111" even if the A/D converter has data which is seven bits in depth, the correction data can be only substantially changed in the range of four bits. Therefore, the resolution of the density is decreased, so that the density can be represented only at a small number of gray levels.
In order to solve the disadvantage of the conventional technique, a shading correcting method and a shading correcting apparatus which allow a representation of the density at a lot of gray levels by widening the dynamic range of correction data have been invented by the applicant of the present application and disclosed in a patent application (U.S. patent application Ser. No. 08/089,379).
In the shading correcting method according to the prior application, shading correction is made in accordance with the following expression (2) using a predetermined offset OFFSET (preferably, OFFSET=white reference value): ##EQU2##
In the shading correcting method according to the prior application, the offset OFFSET is subtracted from a dividend and a divisor in an division operation executed at the time of the correction. Therefore, if the white reference value takes not the minimum value "0000000" but a value higher than the minimum value which can be inherently taken, for example, "0000111" in a case where the A/D converter has data which is seven bits in depth, for example, the offset OFFSET is subtracted from the white reference value, thereby to make it possible to make such correction that the density is represented by 7 bits. As a result, the dynamic range of the data after the correction can be widened in a predetermined direction (toward the white side in the above described case), whereby the density can be represented at a lot of gray levels.
As a premise of the shading correction based on the foregoing expression (2), the black reference value and the white reference value must be normal values. The black reference value and the white reference value are respectively a value read in a state where the white reference plate is not illuminated and a value read in a state where the white reference plate is illuminated, as described above. If the white reference plate partially becomes dirty, however, the reference value and particularly, the white reference value in the dirty portion becomes high, thereby to make it impossible to obtain a normal white reference value. As a method of solving such a problem, a method of previously determining a certain threshold value and setting, if a white reference value is not less than the threshold value, the read white reference value to a predetermined value is considered.
More specifically, description is made with reference to the drawings.
In FIG. 8, reference numeral 141 denotes a white reference plate. A direction indicated by an arrow 142 shall be the direction of reading (the direction of horizontal scanning) by a line image sensor. In this case, if the white reference plate 141 is not dirty at all, digital data obtained by converting outputs of the line image sensor obtained in a state where the white reference plate 141 is illuminated become data of a plurality of pixels as indicated in a row A. The reason why the data of each of the pixels in the row A is not at a complete white level (the density is 00h) is that there are nonuniformity in illumination of a light source for reading and variation in the outputs of the line image sensor.
If the white reference plate 141 partially becomes dirty, for example, dirt adheres to an area 143, the density level of a pixel 144 corresponding to the area 143 becomes high. In this case, a method of previously determining a certain threshold value WMAX and setting not an output value of the line image sensor but a predetermined low value WDN as a white reference value with respect to a pixel whose density level is higher than the threshold value WMAX is considered. Even if the white reference plate 141 partially becomes dirty, therefore, the dirt does not affect the white reference value, thereby to make it possible to make good shading correction.
Thin dirt may, in some cases, adhere to the whole of the white reference plate 141 as the white reference plate 141 is used in addition to the above described case where the white reference plate 141 partially becomes dirty. In such a case, white reference values of pixels obtained by reading the white reference plate 141 become high as a whole. For example, data of a plurality of pixels as indicated in a row B in FIG. 8 are obtained. The reason why the density levels of the pixels in the row B are high as a whole is that thin dirt adheres to the whole of the white reference plate 141. In such a case, if the density level of a certain pixel 145 exceeds the set threshold value WMAX, the white reference value of the pixel 145 is set to a low value WDN. Consequently, the white reference value becomes very low only with respect to a pixel whose density level exceeds the threshold value WMAX. That is, only the white reference value of a pixel whose density level exceeds the threshold value WMAX becomes extremely lower than the white reference values of the other pixels. If shading correction is made on the basis of such a white reference value, a pixel whose white reference value becomes extremely low becomes black, whereby a black stripe extending in the direction of vertical scanning appears in an output image.
The black stripe thus appears in the output image by shading correction for making the output image good, thereby to make it impossible to make good shading correction.
Furthermore, if the shading correction is made in consideration of the offset OFFSET as described above, the dynamic range of data after the correction is widened. In this case, however, the dynamic range cannot be arbitrarily widened toward the black side or the white side. In the related art, therefore, an obtained image cannot be freely changed to an image inclined toward the white side or an image inclined toward the black side.